<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浮动</title>
    <script src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script>
    <style>
        .contain {
            /* border: solid 1px red; */
            overflow: auto;
            width: 800px;
            margin: auto;
        }
        
        .d {
            width: 200px;
            height: 200px;
            background-color: #005397;
            font-size: 22px;
            color: #fff;
            white-space: nowrap;
            float: left;
            margin: 10px;
            text-align: center;
            line-height: 200px;
            border-radius: 15px;
        }   
        
        .d:hover {
            background-color: #337ab7 !important;
        }
        
        .contain div:nth-of-type(1) {
            background-color: #005397;
        }
        
        .contain div:nth-of-type(5) {
            background-color: #005397;
        }
        
        .contain div:nth-of-type(9) {
            background-color: #005397;
        }
    </style>
</head>

<body>
    <div class="contain">
        <div class="d">1</div>
        <div class="d">2</div>
        <div class="d">3</div>
        <div class="d">4</div>
        <div class="d">5</div>
        <div class="d">6</div>
        <div class="d">7</div>
        <div class="d">8</div>
        <div class="d">9</div>
    </div>

</body>

<script>
    var count = Math.floor(Math.random * 100);
    console.log("count:" + count);
</script>

</html>